<?php
/**
* Field.php
*
* Contains Simple class definition
* @author  John Snook <jsnook@gmail.com>
* @version 2
* @copyright (c) Snook 2004
* @package QuickDataFiles
*/

/**
* QDf_Field
*
* This class is the base class of all  other QDF edit controls.
* @author  John Snook <jsnook@gmail.com>
* @version 2
* @copyright (c) Snook 2004
* @example /var/www/corp/IntraDox/Documents.php
* @todo Convert to PEAR::DB, break out superclass from simple text class.
* @package QuickData
* @abstract
* @subpackage QuickDataFields
*/
class Field
{
	/**
	* The Parent property allows a field to gain access to its' containing DataForm object.
	*
	* @access public
	* @var DataForm
	*/
	var $Parent = NULL;
	/**
	* The Caption property.  It doesn't add a ':' unless you specify it
	*
	* @access public
	* @var string
	*/
	var $Caption = "";
	/**
	* The name of the field in it's data table.
	*
	* @access public
	* @var string
	*/
	var $LocalField = "";
	/**
	* Determines whether or not the user will be able to update this fields value.
	*
	* @access public
	* @var bool
	*/
	var $CanEdit = TRUE;
	/**
	* Determines whether or not the user will be able to update this fields value when adding a field.
	*
	* @access public
	* @var bool
	*/
	var $CanAdd = TRUE;
	/**
	* Determines whether or not we will call the Update() function.
	*
	* @access public
	* @var bool
	*/
	var $CanInsert = TRUE;
	/**
	* Determines whether or not we will include this field in the GetQuery() function when used for searching (2005.05.09)
	*
	* @access public
	* @var bool
	*/
	var $CanSearch = TRUE;
	/**
	* Determines whether or not we will include this field in the GetQuery() function.
	*
	* @access public
	* @var bool
	*/
	var $CanQuery = TRUE;
	/**
	* This is the fields key.
	*
	* @access public
	* @var string
	*/
	var $Key = NULL;
	/**
	* This is the fields value.
	*
	* @access public
	* @todo Make Field->Value private and add accessors.  Also add a _NewValue property to determine if the field is dirty.
	* @var mixed
	*/
	var $Value = NULL;
	/**
	* Allows a user to "hide" a field.  This is experimental.
	*
	* @access public
	* @todo Make Field->Value private and add accessors.  Also add a _NewValue property to determine if the field is dirty.
	* @var $field An array of properties from the xml definition
	*/
	var $Visible = TRUE;

	function Field($Properties) //was $Caption, $LocalField
	{
		foreach($Properties->attributes() as $key => $value)
		{
			eval("\$this->key = '$value';");
		}
	}

}
?>